// 导入包
import WxmpRsa from 'wxmp-rsa'

// 定义公钥
const publicKey = `MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCpprMi3n2KL/OQk8m7aG/v2UFOm5mhCsSE+7N8sAa3to3rIp9os1cxwQFpSiwTi4x69WGCVita3q1DqEm/KVdA5abXl92dlS4UsOuMS6Lj4WJewrUgwTQTrg5/i3vMWjt1OANc6N/wAa5/h8ybUXGY72H8kQL3zN5ECxEH7VuzBQIDAQAB`

export default {
  // 加密
  encrypt(password) {
      const rsa = new WxmpRsa()
      rsa.setPublicKey(publicKey) // 设置公钥
      return rsa.encryptLong(password) // 对数据进行加密
  }
}